with open(r"E:\workspace\mypython\src\python5-18\test.txt",'r') as f1:
    lines = f1.readlines()
with open(r"E:\workspace\mypython\src\python5-18\test.txt",'w') as f2:
    for line in lines:
        if "a" in line.split(" "):
            continue
        f2.write(line)